package com.diandian.backend.order.param;

import com.diandian.base.boot.starter.exception.DefaultException;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.diandian.backend.order.dto.OrderOnlineDouyinLifeDetailPageParamDTO;

import java.io.Serializable;
import java.util.Date;

public class OrderOnlineDouyinLifeDetailPageParam implements Serializable {

	private Integer pageNum;
	private Integer pageSize;
	private String belongEql;
	private String belongLike;
	private String onlineOrderNumEql;
	private String onlineOrderNumLike;
	private String onlineOrderCouponIdEql;
	private String onlineOrderCouponIdLike;
	private String onlineOrderCouponNameEql;
	private String onlineOrderCouponNameLike;
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date createTimeBefore;
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date createTimeAfter;
	private Integer del;

	public void check(){
		if(this.belongEql == null || "".equals(this.belongEql)){
			throw new DefaultException("归属标识不能为空");
		}
		if(this.pageNum == null || this.pageNum < 1 || this.pageSize == null || this.pageSize < 1){
			throw new DefaultException("分页参数不合法");
		}
	}

	public OrderOnlineDouyinLifeDetailPageParamDTO toDTO(){
		OrderOnlineDouyinLifeDetailPageParamDTO result = new OrderOnlineDouyinLifeDetailPageParamDTO();
		result.setPageNum(this.pageNum);
		result.setPageSize(this.pageSize);
		result.setBelongEql(this.belongEql);
		result.setBelongLike(this.belongLike);
		result.setOnlineOrderNumEql(this.onlineOrderNumEql);
		result.setOnlineOrderNumLike(this.onlineOrderNumLike);
		result.setOnlineOrderCouponIdEql(this.onlineOrderCouponIdEql);
		result.setOnlineOrderCouponIdLike(this.onlineOrderCouponIdLike);
		result.setOnlineOrderCouponNameEql(this.onlineOrderCouponNameEql);
		result.setOnlineOrderCouponNameLike(this.onlineOrderCouponNameLike);
		result.setCreateTimeBefore(this.createTimeBefore);
		result.setCreateTimeAfter(this.createTimeAfter);
		result.setDel(this.del);
		return result;
	}

	public Integer getPageNum() {
		return pageNum;
	}

	public void setPageNum(Integer pageNum) {
		this.pageNum = pageNum;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}
	public String getBelongEql() {
		return belongEql;
	}
	public void setBelongEql(String belongEql) {
		this.belongEql = belongEql;
	}
	public String getBelongLike() {
		return belongLike;
	}
	public void setBelongLike(String belongLike) {
		this.belongLike = belongLike;
	}
	public String getOnlineOrderNumEql() {
		return onlineOrderNumEql;
	}
	public void setOnlineOrderNumEql(String onlineOrderNumEql) {
		this.onlineOrderNumEql = onlineOrderNumEql;
	}
	public String getOnlineOrderNumLike() {
		return onlineOrderNumLike;
	}
	public void setOnlineOrderNumLike(String onlineOrderNumLike) {
		this.onlineOrderNumLike = onlineOrderNumLike;
	}
	public String getOnlineOrderCouponIdEql() {
		return onlineOrderCouponIdEql;
	}
	public void setOnlineOrderCouponIdEql(String onlineOrderCouponIdEql) {
		this.onlineOrderCouponIdEql = onlineOrderCouponIdEql;
	}
	public String getOnlineOrderCouponIdLike() {
		return onlineOrderCouponIdLike;
	}
	public void setOnlineOrderCouponIdLike(String onlineOrderCouponIdLike) {
		this.onlineOrderCouponIdLike = onlineOrderCouponIdLike;
	}
	public String getOnlineOrderCouponNameEql() {
		return onlineOrderCouponNameEql;
	}
	public void setOnlineOrderCouponNameEql(String onlineOrderCouponNameEql) {
		this.onlineOrderCouponNameEql = onlineOrderCouponNameEql;
	}
	public String getOnlineOrderCouponNameLike() {
		return onlineOrderCouponNameLike;
	}
	public void setOnlineOrderCouponNameLike(String onlineOrderCouponNameLike) {
		this.onlineOrderCouponNameLike = onlineOrderCouponNameLike;
	}
	public Date getCreateTimeBefore() {
		return createTimeBefore;
	}
	public void setCreateTimeBefore(Date createTimeBefore) {
		this.createTimeBefore = createTimeBefore;
	}
	public Date getCreateTimeAfter() {
		return createTimeAfter;
	}
	public void setCreateTimeAfter(Date createTimeAfter) {
		this.createTimeAfter = createTimeAfter;
	}
	public Integer getDel() {
		return del;
	}
	public void setDel(Integer del) {
		this.del = del;
	}
}
